package de.windeln.marketing.validation;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ErrorEntities implements Serializable {

	private static final String VALUE = "value";

	private static final String KEY = "key";

	private static final long serialVersionUID = 7110853604228761892L;
	
	private List<Map<String, String>> errors = new ArrayList<Map<String, String>>();

	public List<Map<String, String>> getErrors() {
		return errors;
	}

//	public void setError(Map<String, String> errors) {
//		this.errors = errors;
//	}

	public void addError(String propertyName, String defaultMessage) {	
		Map<String, String> error = new HashMap<>();
		error.put(KEY, propertyName);
		error.put(VALUE, defaultMessage);
		errors.add(error);
	}
	
	

}
